package com.ruoyi.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
public class ApiKeyEntity {

    private int id;

    private int platformId;

    private String key;

    private BigDecimal quota;

    private int creatorId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date createTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    private Date updateTime;

    private int state;

    private int billingState;

    private BigDecimal billingUsage;

    private BigDecimal billingSubs;

    private int callCount;

    private String remark;

    private String platformName;

    private String creatorName;

    private List<AiModelEntity> models;

    // 适用的模型id
    private List<Integer> modelIds;


    public static final int STATE_NORMAL = 1;
    public static final int STATE_DISABLED = 2;
    public static final int STATE_DELETED = 3;

    public static final int BILLING_STATE_UNKNOWN = 0; // 开始，未知
    public static final int BILLING_STATE_NORMAL = 1; // 正常，额度正常
    public static final int BILLING_STATE_ERROR = 10; // 错误，具体原因未知
    public static final int BILLING_STATE_BLOCKED = 11; // key已经被禁用
    public static final int BILLING_STATE_EXPIRED = 12; // key过期
    public static final int BILLING_STATE_INVALID = 13; // 非法key
    public static final int BILLING_STATE_QUOTA = 14; // 额度不足
}
